<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->linkButton($this->__('system.button.delete'), "deleteGridChecked('grid', '".$this->buildUrl('*/*/*/delete')."')"));
echo $t->renderItem($this->link($this->__('system.button.install'), $this->buildUrl('*/*/*/install')));
echo $t->renderEnd();

$this->nextBlock('grid');
$g = $this->grid('grid', $this->list->toArray());
echo $g->renderBegin();
echo $g->renderHeadBegin();
echo $g->emptyHead()->setStyle('width', 30);
echo $g->labelHead($this->__('system.label.code'))->setStyle('width', 100)->toHtml();
echo $g->labelHead($this->__('system.label.name'))->setStyle('width', 100)->toHtml();
echo $g->labelHead($this->__('system.label.default'))->setStyle('width', 60)->toHtml();
echo $g->labelHead($this->__('system.label.description'))->toHtml();
echo $g->labelHead($this->__('system.label.status'))->setStyle('width', 60)->toHtml();
echo $g->renderHeadEnd();
while($g->nextRow()):
    $currentRow = $g->getCurrentRow();
	echo $g->renderRowBegin();
	echo $g->indexCell()->toHtml();
    echo $g->labelCell('{code}')->toHtml();
	echo $g->labelCell('{name}')->toHtml();
    $cell = $g->booleanCell('{is_default}');
    echo $cell->renderBegin().$cell->renderChildren();
    if(!$currentRow['is_default']):
    echo '<a href="'.$this->buildUrl('*/*/*/default', array('id'=>'{id}')).'">'.$this->__('system.button.default').'</a>';
    endif;
    echo $cell->renderEnd();
    echo $g->labelCell('{description}')->toHtml();
    echo $g->statusLabelCell('{status}')->toHtml();    
	echo $g->renderRowEnd();
endwhile;
echo $g->renderEnd();

$this->nextBlock('pagination');
echo $this->pagination($this->recordCount)->toHtml();
$this->endBlock();

echo $this->extend('template'.DS.'list');